<@cms.editorHistory id=id><#assign a=object/></@cms.editorHistory>
<div class="pageFormContent" layoutH>
    <div class="unit">
        <table class="compare">
            <tr>
                <td><@t.page 'compare.history'/></td>
                <td><@t.page 'compare.now'/></td>
                <td><@t.page 'compare'/></td>
            </tr>
            <tr>
                <td>
                    <textarea name="old" class="code" readOnly="readOnly">${(a.text)!}</textarea>
                </td>
                <td>
                    <textarea name="new" class="code" readOnly="readOnly"></textarea>
                </td>
                <td>
                    <div class="clearfix">
                        <label>
                            <select name="comparetype">
                            <#list ['chars','words','lines','sentence'] as o>
                                <option value="${o}"><@t.page 'compare.type.'+o/></option>
                            </#list>
                            </select>
                        </label>
                    </div>
                    <pre class="result-box"></pre>
                </td>
            </tr>
        </table>
    </div>
    <script>
    $('form',navTab.getCurrentPanel()).trigger(JUI.eventType.editorSync);
    var fieldName = <#if 'content'=a.itemType>"${(a.fieldName)!'text'}";<#else>$('[value=${(a.fieldName)!"text"}]',navTab.getCurrentPanel()).attr('name').replace('.name','.value');</#if>
    $('textarea[name=new]',$.pdialog.getCurrent()).val($('[name='+escapeJquery(fieldName)+']',navTab.getCurrentPanel()).val());
    </script>
</div>
<div class="formBar">
    <ul>
        <li><a href="javascript:;" onclick="$.bringBack({'<#if 'content'=a.itemType>${(a.fieldName)!'text'}<#else>value</#if>':$('textarea[name=content]',$.pdialog.getCurrent()).val()});" class="button"><i class="icon-ok"></i><@t.page 'select'/></a></li>
        <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
    </ul>
</div>